package studyOwn;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;

public class CopyFileDemo1 {
    public static void main(String[] args) throws IOException {

        // 创建输入流
        FileInputStream fis = new FileInputStream("funCode\\fis.txt");

        /*
        byte[] bytes = new byte[4];

        int n = fis.read(bytes);//n为实际读到的字符串长度
        System.out.println(new String(bytes));


        fis.read(bytes);
        System.out.println(new String(bytes));


        fis.read(bytes);
        System.out.println(new String(bytes));
        */

        //
        byte[] bytes = new byte[1024];
        int len;
        while ((len = fis.read(bytes)) != -1) {
            System.out.println(new String(bytes));
        }

        fis.close();
    }
}
